//
//  CABankListTableViewCell.m
//  LNH
//
//  Created by twentylx on 2018/2/8.
//  Copyright © 2018年 twentylx. All rights reserved.
//

#import "CABankListTableViewCell.h"

@implementation CABankListTableViewCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubview:self.bankIconImageView];
        [self addSubview:self.bankName];
        [self addSubview:self.lineView];
        
        [_bankIconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(20);
            make.centerY.equalTo(self);
        }];
        
        [_bankName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.bankIconImageView.mas_right).offset(40);
             make.centerY.equalTo(self);
        }];
        
        [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.and.right.equalTo(self);
            make.bottom.equalTo(self);
            make.height.mas_equalTo(ONE_PIXEL);
        }];
    }
    return self;
}

#pragma mark get & set
- (UIImageView *)bankIconImageView {
    if (!_bankIconImageView) {
        _bankIconImageView = [UIImageView new];
    }
    return _bankIconImageView;
}

- (UILabel *)bankName {
    if (!_bankName) {
        _bankName = [UILabel new];
        _bankName.font = [UIFont systemFontOfSize:14];
    }
    return _bankName;
}

- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [UIView new];
        _lineView.backgroundColor = RGBCOLOR(198, 198, 198);
    }
    return _lineView;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end

